<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$g4['charset']?>" />
<title>회원가입</title>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" rel="stylesheet" />
<link href="../css/style.css" rel="stylesheet" type="text/css">
<script>
var member_skin_path = "<?=$member_skin_path?>";
var g4_path = "<?=$g4['path']?>";
var g4_is_member = "<?=$is_member?>";
var g4_bbs = "<?=$g4['bbs']?>";

var flen = 1;
function addDirectAddr()
{

    if (flen > 2)
    {
        alert("직거래 가능지역은 "+flen+"개 까지만 등록이 가능합니다.");
        return;
    }

    if (flen == 1)
    {
        document.getElementById("jik2_1").style.display = "";
        //document.getElementById("jik2_2").style.display = "";
    }

    if (flen == 2)
    {
    	document.getElementById("jik3_1").style.display = "";
        //document.getElementById("jik3_2").style.display = "";
    }

    flen++;
}

function delDirectAddr()
{

    if (flen <= 1)
    {
        alert("더이상 삭제할 수 없습니다.");
        return;
    }

    if (flen == 2)
    {
        document.getElementById("jik2_1").style.display = "none";
        //document.getElementById("jik2_2").style.display = "";
    }

    if (flen == 3)
    {
    	document.getElementById("jik3_1").style.display = "none";
        //document.getElementById("jik3_2").style.display = "";
    }

    flen--;
}

function addressChk(chk){
	if (chk.checked)
	{
		document.getElementById("mb_addr1_1").value = document.getElementById("mb_addr1").value;
		//document.getElementById("mb_addr1_2").value = document.getElementById("mb_addr2").value;
	}
	else
	{
		document.getElementById("mb_addr1_1").value = "";
		//document.getElementById("mb_addr1_2").value = "";
	}
}

function goPhoneNum(){
	if ($("#juminid1").val()=="" || $("#juminid2").val()==""){
		alert ("주민번호를 입력하십시오.");
		return;
	}
	if ($("#mb_name").val()==""){
		alert ("이름을 입력하십시오.");
		return;
	}
	if ($("#hpComp").val()==""){
		alert ("통신사를 입력하십시오.");
		return;
	}
	if ($("#mb_tel_1").val()=="" || $("#mb_tel_2").val()=="" || $("#mb_tel_3").val()==""){
		alert ("연락처를 입력하십시오.");
		return;
	}
	
	$.ajax({
		  type: "POST",
		  url: "/skin/member/basic2/phone_num_ajax.php",
		  data: {
			  "juminid": $("#juminid1").val()+$("#juminid2").val(),
			  "name": "111",
			  "hpComp": $("#hpComp").val(),
			  "hp_num": $("#mb_tel_1").val()+$("#mb_tel_2").val()+$("#mb_tel_3").val()
		  },
		  success: function(html){
			  var spData = html.split("|");
			  if (spData.length == 3 && spData[0]=="0000"){
				  alert ('실명인증성공\n인증번호를 입력하십시오.');
				  $("#RequestSeq").val(spData[1]);
				  $("#ResponseSeq").val(spData[2]);
				  $("#divPhoneResult").show();
			  }else{
				  alert ("인증정보가 맞지 않습니다.");
			  }
		  }
	});
}

function goPhoneResult(){
	if ($("#juminid1").val()=="" || $("#juminid2").val()==""){
		alert ("주민번호를 입력하십시오.");
		return;
	}
	if ($("#mb_name").val()==""){
		alert ("이름을 입력하십시오.");
		return;
	}
	if ($("#hpComp").val()==""){
		alert ("통신사를 입력하십시오.");
		return;
	}
	if ($("#mb_tel_1").val()=="" || $("#mb_tel_2").val()=="" || $("#mb_tel_3").val()==""){
		alert ("연락처를 입력하십시오.");
		return;
	}
	if ($("#authNum").val()==""){
		alert ("인증번호를 입력하십시오.");
		return;
	}
	
	$.ajax({
		  type: "POST",
		  url: "/skin/member/basic2/phone_result_ajax.php",
		  data: {
			  "juminid": $("#juminid1").val()+$("#juminid2").val(),
			  "RequestSeq": $("#RequestSeq").val(),
			  "ResponseSeq": $("#ResponseSeq").val(),
			  "authNum": $("#authNum").val()
		  },
		  success: function(html){
			  var spData = html.split("|");

			  if (spData.length == 4 && spData[0]=="0000"){
				  alert ('핸드폰 인증 완료');
				  $("#mb_name").attr("disabled","disabled");
				  $("#juminid1").attr("disabled","disabled");
				  $("#juminid2").attr("disabled","disabled");
				  $("#mb_tel_1").attr("disabled","disabled");
				  $("#mb_tel_2").attr("disabled","disabled");
				  $("#mb_tel_3").attr("disabled","disabled");
			  }else{
				  alert ('핸드폰 인증 실패');
			  }
		  }
	});
	$("#divPhoneResult").hide();
}
</script>
<script type="text/javascript" src="<?=$g4['path']?>/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<?=$g4['path']?>/js/common.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?=$member_skin_path?>/ajax_register_form.jquery.js"></script>
<script type="text/javascript" src="<?=$g4[path]?>/js/md5.js"></script>
</head>

<body>
<input type="hidden" name="RequestSeq" id="RequestSeq"/>
<input type="hidden" name="ResponseSeq" id="ResponseSeq"/>
<form id="fregisterform" name=fregisterform method=post onsubmit="return fregisterform_submit(this);" enctype="multipart/form-data" autocomplete="off">
<input type=hidden name=w                value="">
<input type=hidden name=url              value="">
<input type=hidden name=mb_jumin         value="">
<input type=hidden name=mb_id_enabled    value="" id="mb_id_enabled">
<input type=hidden name=mb_nick_enabled  value="" id="mb_nick_enabled">
<input type=hidden name=mb_email_enabled value="" id="mb_email_enabled">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><table width="860" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="17">&nbsp;</td>
      </tr>
      <tr>
        <td align="right">
          <a href="<?=$g4['bbs_path']?>/login.php?url=<?=$urlencode?>"><img src="../img/comm/smenu01.gif" alt="" width="29" height="12" border="0" /></a>
          <img src="../img/comm/smenu_line.gif" width="2" height="12" hspace="7" />
          <a href="<?=$g4['bbs_path']?>/register.php"><img src="../img/comm/smenu_join.gif" width="38" height="12" border="0" /></a>
        </td>
      </tr>
      <tr>
        <td height="22">&nbsp;</td>
      </tr>
      <tr>
        <td height="115" align="center" valign="top"><a href="/"><img src="../img/comm/logo.gif" width="302" height="71" border="0" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="145" align="center" background="../img/comm/search_bg.gif"><table width="476" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="../img/seoul/step01.gif" width="105" height="100" /></td>
            <td align="center"><img src="../img/seoul/step02_on.gif" width="106" height="100" /></td>
            <td align="right"><img src="../img/seoul/step03.gif" width="106" height="100" /></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="188" valign="top"><table width="644" border="0" align="center" cellspacing="0">
      <tr>
        <td height="62" colspan="2">&nbsp;</td>
        </tr>
      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" width="715" height="1" vspace="2" /></td>
        </tr>
      <tr>
        <td width="126" height="28" bgcolor="E9E9E9" class="left14">이름</td>
        <td class="left14">
          <input type="text" name="mb_name" id="mb_name" itemname="이름" class="box3" required/> (공백없이 한글만 입력 가능)
        </td>
      </tr>
      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr>
	  <tr>
            <td width="126" height="28" bgcolor="E9E9E9" class="left14">별명</td>
            <td class="left14">
                <input class="box3" type="text" id="reg_mb_nick" name="mb_nick" maxlength="20" required onblur="reg_mb_nick_check();">
                <span id='msg_mb_nick'></span>
                <br>공백없이 한글,영문,숫자만 입력 가능 (한글2자, 영문4자 이상)
            </td>
        </tr>
		<tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr>
		<tr>
        <td height="28" bgcolor="E9E9E9" class="left14">아이디</td>
        <td class="left14">
          <input type="text" maxlength=20 size=20 required name="mb_id" itemname="아이디" id="reg_mb_id" class="box3" onblur='reg_mb_id_check();' />
          <span id='msg_mb_id'></span>
            <table height=25 cellspacing=0 cellpadding=0 border=0>
              <tr>
                <td>
                  <font color="#66a2c8">※ 영문자, 숫자, _ 만 입력 가능. 최소 3자이상 입력하세요.</font>
                </td>
              </tr>
            </table>
        </td>
      </tr>
      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr>
		<tr>
        <td height="28" bgcolor="E9E9E9" class="left14">비밀번호</td>
        <td class="left14">
          <input type="password" name="mb_password" itemname="비밀번호" required class="box3" />
                           비밀번호 확인 
          <input type=password name="mb_password_re" size=20 maxlength=20 itemname="비밀번호 확인" required class="box3" />
        </td>
      </tr>
      


      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr>
      <tr>
        <td height="28" bgcolor="E9E9E9" class="left14" rowspan="2">주민번호</td>
        <td class="left14">
          <input type="password" name="juminid1" id="juminid1" itemname="주민번호" maxlength=6 class="box3" />-
          <input type="password" name="juminid2" id="juminid2" itemname="주민번호" size=20 maxlength=7 class="box3" />
        </td>
      </tr>
      <tr>
      	<td class="left14">
      		<font color="#66a2c8">※ 주민번호는 핸드폰 인증을 위해서만 사용됩니다. 마켓서울에 저장되지 않습니다.</font>
      	</td>
      </tr>
      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr>
      
	  <tr>
        <td height="28" bgcolor="E9E9E9" class="left14">연락처</td>
        <td class="left14">
          <table width="250" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>
                <table width="10" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td>
                      <select name="mb_tel_1" id="mb_tel_1" required itemname='연락처'>
                        <option value=""></option>
                       	<option value="010">010</option>
                        <option value="011">011</option>
                        <option value="016">016</option>
                        <option value="017">017</option>
                        <option value="018">018</option>
                        <option value="019">019</option>
                      </select>
                    </td>
                  </tr>
                </table>
              </td>
              <td> - </td>
              <td>
                <input type="text" name="mb_tel_2" id="mb_tel_2" itemname='연락처' size="4" maxlength="4" class="box3" required />
              </td>
              <td> - </td>
              <td>
                <input type="text" name="mb_tel_3" id="mb_tel_3" itemname='연락처' size="4" maxlength="4" class="box3" required />
                
              </td>
              <td>
              	<select name="hpComp" id="hpComp">
					<option value="1">SKT</option>
					<option value="2">KTF</option>
					<option value="3">LGT</option>
				</select>
              </td>
              <!--td>
              	<a href="javascript:goPhoneNum();">인증</a>
              </td>
              <td>
              <div id="divPhoneResult" style="display:none;">
              	인증번호:<input type="text" name="authNum" id="authNum" value="" size="5" maxlength="5" class="box3">
              	<a href="javascript:goPhoneResult();">확인</a>
              </div>
              </td-->
            </tr>
        </table></td>
      </tr>
      
      
      
      <!--tr>
        <td height="28" bgcolor="E9E9E9" class="left14">휴대폰 인증</td>
        <td class="left14">
          <table width="380" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>
                <table width="10" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td>
                      <select name="mb_tel_1" id="mb_tel_1" required itemname='연락처'>
                        <option value=""></option>
                       	<option value="010">010</option>
                        <option value="011">011</option>
                        <option value="016">016</option>
                        <option value="017">017</option>
                        <option value="018">018</option>
                        <option value="019">019</option>
                      </select>
                    </td>
                  </tr>
                </table>
              </td>
              <td> - </td>
              <td>
                <input type="text" name="mb_tel_2" id="mb_tel_2" itemname='연락처' size="4" maxlength="4" class="box3" required />
              </td>
              <td> - </td>
              <td>
                <input type="text" name="mb_tel_3" id="mb_tel_3" itemname='연락처' size="4" maxlength="4" class="box3" required />
                
              </td>
              <td>
              	<select name="hpComp" id="hpComp">
					<option value="1">SKT</option>
					<option value="2">KTF</option>
					<option value="3">LGT</option>
				</select>
              </td>
              <td>
              	<a href="javascript:goPhoneNum();">인증</a>
              </td>
              <td>
              <div id="divPhoneResult" style="display:none;">
              	인증번호:<input type="text" name="authNum" id="authNum" value="" size="5" maxlength="5" class="box3">
              	<a href="javascript:goPhoneResult();">확인</a>
              </div>
              </td>
            </tr>
        </table></td>
      </tr-->
      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr>
      <tr>
        <td height="14" bgcolor="E9E9E9" class="left14">이메일</td>
        <td class="left14">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="26%">
                <input type="text" name='mb_email_1' id='reg_mb_email_1' class="box3" maxlength="30" itemname='이메일' required onblur="reg_mb_email_check();" />
              </td>
              <td width="4%" align="center">@ </td>
              <td width="26%">
                <input type="text" name='mb_email_2' id='reg_mb_email_2' class="box3" maxlength="30" itemname='이메일' required onblur="reg_mb_email_check();" />
              </td>
              <td width="44%">이메일수신동의 
                <input type="radio" name="mb_mailling" id="mb_mailling" value="1" checked />
                예 
                <input type="radio" name="mb_mailling" id="mb_mailling" value="0" />
                아니오      </td>
           </tr>
        </table></td>
      </tr>
      <tr>
        <td height="14" class="left14">&nbsp;</span></td>
        <td height="20"  class="left14">
          <span id='msg_mb_email'>
          * 거래의 연락수단으로 이용될수있으니 정확하게 기입하여 주시기바랍니다.
          </span>
          <!-- <br> * e-mail 로 발송된 내용을 확인한 후 인증하셔야 회원가입이 완료됩니다. -->
        </td>
      </tr>
      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr>
      <!-- tr>
        <td height="28" bgcolor="E9E9E9" class="left14">주소</td>
        <td class="left14"><table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="45%">
              <input type="text" name="mb_addr1" id="mb_addr1" itemname='주소' size=60 style="width:98%" class="box3" readonly required />
            </td>
            <td width="9%">
              <a href="javascript:;" onclick="win_zip('fregisterform', 'mb_zip1', 'mb_zip2', 'mb_addr1', 'mb_addr2');"><img src="../img/seoul/bt_search.gif" alt="" width="45" height="28" hspace="3" border="0" /></a>
            </td>
            <td width="46%">동(읍/면/리/가)</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr>
      <tr style="display:none";>
        <td height="14" bgcolor="E9E9E9" class="left14">나머지</td>
        <td class="left14">
          <input name="mb_addr2" id="mb_addr2" type="text" size=60 itemname='나머지' class="box3" />
        </td>
      </tr>
      <tr>
        <td height="14" class="left14">&nbsp;</td>
        <td height="30" class="left14"><input type="checkbox" name="addrChk" id="addrChk" onclick="javascript:addressChk(this);" /> 
                직거래가능 지역이 주소지와 같습니다.
        </td>
      </tr>
      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr>
    
      <tr>
        <td height="14" bgcolor="E9E9E9" class="left14" nowrap="nowrap">직거래가능지역</td>
        <td class="left14">
          <table border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="45%">
              <input type="text" name="mb_addr1_1" id="mb_addr1_1" itemname='직거래가능지역' size=60 style="width:98%" class="box3" readonly required />
            </td>
            <td width="9%">
              <a href="javascript:;" onclick="win_zip('fregisterform', 'mb_zip1', 'mb_zip2', 'mb_addr1_1', 'mb_addr1_2');"><img src="../img/seoul/bt_search.gif" alt="" width="45" height="28" hspace="3" border="0" /></a>
            </td>
            <td width="46%">동(읍/면/리/가)</td>
            </tr>
          </table>
        </td>
      </tr>
      <tr style="display:none;">
        <td height="14" class="left14">&nbsp;</td>
        <td height="30"  class="left14">
          <input name="mb_addr1_2" id="mb_addr1_2" type="text" size=60 itemname='직거래가능지역' class="box3" />
        </td>
      </tr>
      
      <tr id="jik2_1" style="display:none;">
        <td height="14" bgcolor="E9E9E9" class="left14" nowrap="nowrap">직거래가능지역</td>
        <td class="left14">
          <table border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="45%">
              <input type="text" name="mb_addr2_1" id="mb_addr2_1" itemname='직거래가능지역' size=60 style="width:98%" class="box3" readonly />
            </td>
            <td width="9%">
              <a href="javascript:;" onclick="win_zip('fregisterform', 'mb_zip1', 'mb_zip2', 'mb_addr2_1', 'mb_addr2_2');"><img src="../img/seoul/bt_search.gif" alt="" width="45" height="28" hspace="3" border="0" /></a>
            </td>
            <td width="46%">동(읍/면/리/가)</td>
            </tr>
          </table>
        </td>
      </tr>
      <tr id="jik2_2" style="display:none;">
        <td height="14" class="left14">&nbsp;</td>
        <td height="30"  class="left14">
          <input name="mb_addr2_2" id="mb_addr2_2" type="text" size=60 itemname='직거래가능지역' class="box3" />
        </td>
      </tr>
      
      <tr id="jik3_1" style="display:none;">
        <td height="14" bgcolor="E9E9E9" class="left14" nowrap="nowrap">직거래가능지역</td>
        <td class="left14">
          <table border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="45%">
              <input type="text" name="mb_addr3_1" id="mb_addr3_1" itemname='직거래가능지역' size=60 style="width:98%" class="box3" readonly />
            </td>
            <td width="9%">
              <a href="javascript:;" onclick="win_zip('fregisterform', 'mb_zip1', 'mb_zip2', 'mb_addr3_1', 'mb_addr3_2');"><img src="../img/seoul/bt_search.gif" alt="" width="45" height="28" hspace="3" border="0" /></a>
            </td>
            <td width="46%">동(읍/면/리/가)</td>
            </tr>
          </table>
        </td>
      </tr>
      <tr id="jik3_2" style="display:none;">
        <td height="14" class="left14">&nbsp;</td>
        <td height="30"  class="left14">
          <input name="mb_addr3_2" id="mb_addr3_2" type="text" size=60 itemname='직거래가능지역' class="box3" />
        </td>
      </tr>
      
      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr>
      <tr>
        <td height="28" colspan="2" class="left14">
          <a href="javascript:addDirectAddr();">직거래가능 지역 추가</a>
          &nbsp;&nbsp;
          <a href="javascript:delDirectAddr();">직거래가능 지역 삭제</a>
        </td>
      </tr>
      <tr>
        <td colspan="2"><img src="../img/seoul/join_line.gif" alt="" width="715" height="1" vspace="2" /></td>
      </tr-->
      <tr>
        <td height="28" colspan="2" align="center" class="left14">
          <input type="checkbox" name="agreeChk" id="agreeChk" />
          <span class="point_line">이용약관 </span>및 <span class="point_line">개인정보취급방침</span>에 동의합니다.</td>
      </tr>
      <tr>
        <td height="28" colspan="2" align="center" class="left14">
          <!-- <a href="#"><img src="../img/seoul/bt_join.gif" width="91" height="44" vspace="40" border="0" /></a> -->
          <input type=image width="91" height="44" border="0" style="margin-top:40px;" src="../img/seoul/bt_join.gif" border=0 accesskey='s'>
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center">&nbsp;</td>
  </tr>
</table>
</form>

<script type="text/javascript">
$(function() {
    // 폼의 첫번째 입력박스에 포커스 주기 
    $("#fregisterform :input[type=text]:visible:enabled:first").focus(); 
});

// submit 최종 폼체크
function fregisterform_submit(f) 
{
	if (!$("#mb_name").attr("disabled")){
		alert ("연락처 인증이 완료되지 않았습니다.\n연락처 인증을 하십시오.");
		return false;
	}
	  
	// 이용약관 및 개인정보취급방침 동의 검사
	if (!document.getElementById("agreeChk").checked)
	{
		alert('이용약관 및 개인정보취급방침에 동의하십시오.');
		return false;
	}
    // 회원아이디 검사
    if (f.w.value == "") {

        reg_mb_id_check();

        if (document.getElementById('mb_id_enabled').value!='000') {
            alert('회원아이디를 입력하지 않았거나 입력에 오류가 있습니다.');
            document.getElementById('reg_mb_id').select();
            return false;
        }
    }

    if (f.w.value == '') {
        if (f.mb_password.value.length < 3) {
            alert('패스워드를 3글자 이상 입력하십시오.');
            f.mb_password.focus();
            return false;
        }
    }

    if (f.mb_password.value != f.mb_password_re.value) {
        alert('패스워드가 같지 않습니다.');
        f.mb_password_re.focus();
        return false;
    }

    if (f.mb_password.value.length > 0) {
        if (f.mb_password_re.value.length < 3) {
            alert('패스워드를 3글자 이상 입력하십시오.');
            f.mb_password_re.focus();
            return false;
        }
    }

    /*
    if (f.mb_password_q.value.length < 1) {
        alert('패스워드 분실시 질문을 선택하거나 입력하십시오.');
        f.mb_password_q.focus();
        return false;
    }

    if (f.mb_password_a.value.length < 1) {
        alert('패스워드 분실시 답변을 입력하십시오.');
        f.mb_password_a.focus();
        return false;
    }
    */

    // 이름 검사
    if (f.w.value=='') {
        if (f.mb_name.value.length < 1) {
            alert('이름을 입력하십시오.');
            f.mb_name.focus();
            return false;
        }

        var pattern = /([^가-힣\x20])/i; 
        if (pattern.test(f.mb_name.value)) {
            alert('이름은 한글로 입력하십시오.');
            f.mb_name.focus();
            return false;
        }
    }

    // 별명 검사
    /*if ((f.w.value == "") ||
        (f.w.value == "u" && f.mb_nick.defaultValue != f.mb_nick.value)) {

        reg_mb_nick_check();

        if (document.getElementById('mb_nick_enabled').value!='000') {
            alert('별명을 입력하지 않았거나 입력에 오류가 있습니다.');
            document.getElementById('reg_mb_nick').select();
            return false;
        }
    }*/

    // E-mail 검사
    if ((f.w.value == "") ||
        (f.w.value == "u" && (f.mb_email_1.defaultValue != f.mb_email_1.value || f.mb_email_2.defaultValue != f.mb_email_2.value))) {

        reg_mb_email_check();
        
        if (document.getElementById('mb_email_enabled').value!='000') {
            alert('E-mail을 입력하지 않았거나 입력에 오류가 있습니다.');
            //document.getElementById('reg_mb_email_1').select();
            return false;
        }

        // 사용할 수 없는 E-mail 도메인
        //var domain = prohibit_email_check(f.mb_email.value);
        var domain = prohibit_email_check(f.mb_email_2.value);
        if (domain) {
            alert("'"+domain+"'은(는) 사용하실 수 없는 메일입니다.");
            document.getElementById('reg_mb_email_2').focus();
            return false;
        }
    }

    /*if (typeof(f.mb_birth) != 'undefined') {
        if (f.mb_birth.value.length < 1) {
            alert('달력 버튼을 클릭하여 생일을 입력하여 주십시오.');
            //f.mb_birth.focus();
            return false;
        }

        var todays = <//?=date("Ymd", $g4['server_time']);?>;
        // 오늘날짜에서 생일을 빼고 거기서 140000 을 뺀다.
        // 결과가 0 이상의 양수이면 만 14세가 지난것임
        var n = todays - parseInt(f.mb_birth.value) - 140000;
        if (n < 0) {
            alert("만 14세가 지나지 않은 어린이는 정보통신망 이용촉진 및 정보보호 등에 관한 법률\n\n제 31조 1항의 규정에 의하여 법정대리인의 동의를 얻어야 하므로\n\n법정대리인의 이름과 연락처를 '자기소개'란에 별도로 입력하시기 바랍니다.");
            return false;
        }
    }

    if (typeof(f.mb_sex) != 'undefined') {
        if (f.mb_sex.value == '') {
            alert('성별을 선택하여 주십시오.');
            f.mb_sex.focus();
            return false;
        }
    }

    if (typeof f.mb_icon != 'undefined') {
        if (f.mb_icon.value) {
            if (!f.mb_icon.value.toLowerCase().match(/.(gif)$/i)) {
                alert('회원아이콘이 gif 파일이 아닙니다.');
                f.mb_icon.focus();
                return false;
            }
        }
    }

    if (typeof(f.mb_recommend) != 'undefined') {
        if (f.mb_id.value == f.mb_recommend.value) {
            alert('본인을 추천할 수 없습니다.');
            f.mb_recommend.focus();
            return false;
        }
    }

    if (!check_kcaptcha(f.wr_key)) {
        return false;
    }*/
      $("#mb_name").attr("disabled","");
	  $("#juminid1").attr("disabled","");
	  $("#juminid2").attr("disabled","");
	  $("#mb_tel_1").attr("disabled","");
	  $("#mb_tel_2").attr("disabled","");
	  $("#mb_tel_3").attr("disabled","");
    <?
    if ($g4[https_url])
        echo "f.action = '$g4[https_url]/$g4[bbs]/register_form_update.php';";
    else
        echo "f.action = './register_form_update.php';";
    ?>

    // 보안인증관련 코드로 반드시 포함되어야 합니다.
    set_cookie("<?=md5($token)?>", "<?=base64_encode($token)?>", 1, "<?=$g4['cookie_domain']?>");

    return true;
}

// 금지 메일 도메인 검사
function prohibit_email_check(email)
{
    email = email.toLowerCase();

    var prohibit_email = "<?=trim(strtolower(preg_replace("/(\r\n|\r|\n)/", ",", $config[cf_prohibit_email])));?>";
    var s = prohibit_email.split(",");
    var tmp = email.split("@");
    var domain = tmp[tmp.length - 1]; // 메일 도메인만 얻는다

    for (i=0; i<s.length; i++) {
        if (s[i] == domain)
            return domain;
    }
    return "";
}
</script>

</body>
</html>